package com.wing.generator;


import com.wing.generator.generator.GeneratorFacade;
import com.wing.generator.util.YmlUtils;

/**
 * @author
 */
public class GeneratorMain {

    public static void main(String[] args) throws Exception {
        //表名
        String tableName = YmlUtils.getGeneratorValue( "generator.tableName");
        //父表
        String parentTableName = YmlUtils.getGeneratorValue("generator.parentTableName");
        //祖先表
        String ancestorTableName = YmlUtils.getGeneratorValue("generator.ancestorTableName");
        //子表
        String childTableName = YmlUtils.getGeneratorValue("generator.childTableName");
        GeneratorFacade g = new GeneratorFacade();
        //设置模板位置目录
        g.getGenerator().addTemplateRootDir(YmlUtils.getGeneratorValue("generator.templateRootDir"));
        g.generateByTableAndRelation(tableName, parentTableName, ancestorTableName, childTableName);
    }
}
